package main

import (
	"fmt"
)

func fa(a []int) []int {
	return a
}

func f1() {
	n1 := [...]int{1, 2, 3, 4, 5, 6}
	x4 := n1[:4]
	fmt.Println(x4)
	fmt.Println(x4[:6])
	x5 := append(x4, 7)
	x6 := append(x4, 8)
	x7 := append(x4, 9)
	fmt.Println(x5, x6, x7) // [1 2 3 4 9] [1 2 3 4 9] [1 2 3 4 9]
	fmt.Println(n1)
}

func f2() {
	n1 := [...]int{1, 2, 3, 4, 5, 6}
	x4 := n1[:4]
	fmt.Println(x4)
	fmt.Println(x4[:6])
	x5 := append(x4, 7)
	x6 := append(x5, 8)
	x7 := append(x6, 9)
	fmt.Println(x5, x6, x7) // [1 2 3 4 7] [1 2 3 4 7 8] [1 2 3 4 7 8 9]
	fmt.Println(n1)
}

func main() {
	//var numbers [5]int
	var numbers [5]int
	fmt.Println(numbers)
	n1 := [...]int{1, 2, 3, 4, 5, 6}
	fmt.Println(n1)
	fmt.Println(n1[2:3])
	fmt.Println(n1[2])
	fmt.Println(len(n1))
	fmt.Println(len(n1[:4]))
	fmt.Println(cap(n1))
	fmt.Println(cap(n1[:4]))
	f1()
	f2()
}
